package com.proxy;

import com.proxy.proxyClass.impl.BigStar;
import com.proxy.proxyClass.Star;
import com.proxy.proxyType.BigStarDynamicProxy;
import com.proxy.proxyType.StaticProxy;

import java.util.HashMap;
import java.util.Map;

public class RunProxy {
    public static void main(String[] args) {
//        静态代理
        System.out.println("静态代理！");
        Star starS = new StaticProxy();
        starS.dance();
        starS.sing();
//动态代理
        System.out.println("动态代理！");
        BigStar bigStar = new BigStar("kk");
        Star proxy = BigStarDynamicProxy.createProxy(bigStar);
        proxy.sing();
        proxy.dance();


        Map<String,String> m = new HashMap<>();
        m.put("a","a1");
        m.put("b","b1");

        m.forEach((k,v)->{
            System.out.print(k+", ");
            System.out.println(v);
        });
    }
}
